﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!doctype html>
<html>
<head>
<title>新闻详细</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
 <meta name="format-detection" content="telephone=no">
 <meta name="apple-mobile-web-app-capable" content="yes">
 <meta name="apple-mobile-web-app-status-bar-style" content="black">
<link type="text/css" rel="stylesheet" href="<c:url value='/static/theme/3/main.css'/>">
<script type="text/javascript" src="<c:url value='/static/common/js/jquery-1.11.0.min.js'/>"></script>
</head>

<body class="body_bg">
<!--主体结构开始-->
<div class="home_main"> 
  <!--logo开始-->
  <div class="home_logo"> <img src="<c:url value='/static/theme/3/images/logo.png'/>"/> </div>
  <!--内容详情开始-->
  <div class="details_main"> 
  <div class="container">
   <h1 class="h1"><b>${news.title}</b></h1>
   <p class="time">
   	<span class="zz">
   		<fmt:formatDate value="${news.showdateTime}" type="date" dateStyle="default"/>&nbsp;&nbsp;
	   	<span style="color:#607FA6">${news.author}</span>
   	</span>
   </p>
   <div class="textmain">
   ${news.content }
	</div>
  </div>
</div>
</div>
</body>

<script type="text/javascript">
	$(function(){
		var mobileWidth = $(document.body).outerWidth(true);
		$(".details_main img").each(function(){
			var imgWidth = $(this).width();
			if(imgWidth > mobileWidth){
				$(this).css("width",mobileWidth-40);
			}
		});
	});

	function formatDate(val) {
		var date = new Date(val);
		if (date.getFullYear() > 2048) {
			return "未发布";
		} else {
			return date.getFullYear() + '-' + (date.getMonth() + 1) + '-'
			+ date.getDate();
		}
		
	}
	window.onload = function() {
		//var author = "${news.showdateTime}";
		//$("#author").html(formatDate(author));
	}
</script>
</html>
